﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Default/Site.Master" AutoEventWireup="true" %>
<%@ Import Namespace="WebDotNet.Extensions" %>
<%@ Import Namespace="WebDotNet.Samples.TodoList.App.Entities" %>
<%@ Import Namespace="WebDotNet.Samples.TodoList.App.ViewModels" %>
<script runat="server">
	public Index ViewData
	{
		get
		{
			return (Index)HttpContext.Current.Items[WebFormsExtensions.ViewDataKey];
		}
	}
</script>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
	<form method="post" action="/add">
		<p>
			<input type="text" name="Title" />
			<input type="submit" value="Add" />
		</p>
	</form>
	<ol>
		<% foreach(Todo todo in this.ViewData.ToDos ?? new List<Todo>()) { %>
			<%= this.ViewData.HttpContextBase.RenderControl("ListItem", todo).ToString() %>
		<% } %>
	</ol>
</asp:Content>
